<div id="main">
<div id="contents">
<form name="filters" method="post" >
<fieldset>
<legend><label sid="softupload.param1" id="title_1"></label></legend>
<div class="frame_tab_layer">
	<span id="loading" style="display:none;"><img src="images/load.gif"/><label sid="cfgupload.cprogress"></label></span>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
<tr id="tr50">
<td class="frame_tab_center" id="td50">
<input name="filename" type="file" id="filename" size="35"/>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td class="frame_tab_center" colspan="2">
    <input type="button" name="submit" sid="sbutton.upload" id="myupload"/>
</td>
<script type="text/javascript">
    $("#myupload").val(sbutton.upload);
    $("#title_1").html(softupload.param1);
</script>
</tr>
</table>
</div>
</fieldset>
</form>
</div>
</div>
<br/>
<div id="helpContainer">
    <div id="help">
        <div>
            <h2>
                <label sid="share.help"></label>
            </h2>
        </div>
        <div id="helpBody">
            <dl>

                <dd class="definition">
                    <label sid="softupload.title"></label><br><br>
                </dd>
            </dl>
        </div>
    </div>
</div>

<script type="text/javascript" src="js/ajaxfileupload.js"></script>
<script type="text/javascript">
  $("[name=submit]").click(function () {
        if($("#filename").val()==""){
           alert(guideInfo.upload);
        }else{
            startUpload();
        }

    });

function startUpload() {
    $("[name=submit]").attr("disabled", true);
    $("#loading").show();
    $.ajaxFileUpload({
        url: 'upload',
        secureuri: false,
        fileElementId: 'filename',
        dataType: 'xml',
        success: function (data, status) {
            var stat = $(data).find("rsp").attr("stat");
            if (stat == "ok") {
                $("[name=submit]").attr("disabled", false);
                $("#loading").hide();
               // show_message("success",softupload.upok);
               alert(softupload.upok);
                loadNewHtml("softupgrade.htm")
            } else if (stat == "fail") {
                $("[name=submit]").attr("disabled", false);
                $("#loading").hide();
                var error = $(data).find("error").text();
                //show_message("err",softupload.error);
                alert(softupload.upfail);
            }
        },
        error: function (data, status, e) {
            $("[name=submit]").attr("disabled", false);
            $("#loading").hide();
           // show_message("err",softupload.upfail);
           alert(softupload.upfail);
        }
    });
}
</script>

